def hanoi(n, source, auxiliary, target):
    """
    汉诺塔的实现
    :param n: 盘子的个数，小的在上面，大的在下面
    :param source: 从该柱子开始搬运
    :param auxiliary: 临时辅助柱子
    :param target: 目标柱子
    :return:
    """
    if n == 1:
        print(f'将 {n} 号盘子从 {source} 移动到 {target}')
    else:
        hanoi(n - 1, source, target, auxiliary)
        print(f'将 {n} 号盘子从 {source} 移动到 {target}')
        hanoi(n - 1, auxiliary, source, target)


if __name__ == '__main__':
    hanoi(4, "A", "B", "C")
